(function() {

this.codium = this.codium || {};
this.codium.control = this.codium.control || {};

this.codium.control.IFrame = pasta.webgui.Control.extend(
{
	init : function() 
	{
		this._super();
		
		this.canvas.style.overflow = "hidden";
		this.canvas.style.background = "#FFFFFF";
		this.canvas.style.align = "center";
		
		this.setBorderColor("#000000");
		
		this.imgCanvas = document.createElement("iframe");
		this.imgCanvas.id = this.cid + "_frame";
		this.imgCanvas.style.position = "absolute";
		this.imgCanvas.style.left = "0px";
		this.imgCanvas.style.top = "0px";
		this.imgCanvas.style.width = "100%";
		this.imgCanvas.style.height = "100%";
		this.imgCanvas.frameBorder = "0px";
		
		var target = this;
		
		this.imgCanvas.onload = function() { target.doLoad() }
		
		this.canvas.appendChild(this.imgCanvas);
		
		this.mode = 1;
		this.image = null;
	},
	
	//------------------ Setter & Getter -----------------
	
	doLoad : function()
	{
		if (this._onLoad != null)
			this._onLoad.callHandler(this);
	},
	
	load : function(data)
	{	
		this.imgCanvas.src = data;
	},
	
	getContent : function()
	{
		return this.imgCanvas.contentWindow;
	},
	
	//--------------------------- Event -------------------------
	
	getOnLoad : function()
	{
		if (this._onLoad == null)
			this._onLoad = new pasta.util.EventObj();
		
		return this._onLoad;
	},
});

})();